var modbus = require('./modbus.js');

var deviceAddr = 1;
var device = modbus(
  { id: 'UART2' },
  { id: 'D13', polarity: 1 },
  deviceAddr
);

/* read single coil */
setInterval(function() {
  device.read(deviceAddr, 'hr1-10', 300).then(function(result) {
    console.log('read data ' + result)
  }).catch(function(res) {
    console.log('read fail ' + res)
  });
}, 3000);
